﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyShopThoiTrang.QuanLyShopThoiTrang_BUS_WS;

namespace QuanLyShopThoiTrang
{
    public partial class ThemLoaiHang : Form
    {
        QLSTT_BUSSoapClient ws = new QLSTT_BUSSoapClient();
        QuanLyHangHoa qlhh;
        public ThemLoaiHang()
        {
            InitializeComponent();
        }

        private void ThemLoaiHang_Load(object sender, EventArgs e)
        {
            comboBox1.SelectedIndex = 0;
        }

        public void Set(QuanLyHangHoa ql)
        {
            qlhh = ql;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            LoaiSanPham lsp = new LoaiSanPham();
            lsp.LoaiSanPham_Ten = textBox1.Text;
            lsp.LoaiSanPham_TrangThai = comboBox1.Text;

            if(ws.LoaiSanPham_Them(lsp))
            {
                MessageBox.Show("Thêm thành công.");
                qlhh.FillDatagrid3();
            }
            else
            {
                MessageBox.Show("Thêm thất bại.");
            }
        }
    }
}
